import Vue from 'vue'
import App from './App'
import uView from "uview-ui"
import store from './store'
Vue.use(uView);

Vue.config.productionTip = false
/*****暂时插一个函数***/
Vue.prototype.$checkLogin = function(){
	const token = uni.getStorageSync('token')
	console.log(token);
	if(token === ''){ // 本地没有token表示未登录
		uni.reLaunch({url:'/pages/login/index?permission=请先登录'})
		return false
	}
	return true;
}
Vue.prototype.$checkRole = () => {
	const temp = uni.getStorageSync('user');
	console.log(temp.user.role);
	return temp.user.role === 'customer';
}
/********/
App.mpType = 'app'

const app = new Vue({
    ...App,
	store
})
app.$mount()
